/*
    Carracci Systems - Carracci Server (openbam project)
    Copyright (C) 2007  Carracci Systems

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package org.openbam.core;

import java.util.Date;
import java.util.Map;

import org.apache.commons.collections.IterableMap;
import org.apache.commons.collections.map.HashedMap;

public class Event {

	protected Date eventTime = new Date();
	protected Map attributes = new HashedMap();
	protected Object data;
	protected String streamName;

    public boolean isSearchable() {
        return isSearchable;
    }

    public void setSearchable(boolean searchable) {
        isSearchable = searchable;
    }

    protected boolean isSearchable;

    public Map getAttributes() {
		return attributes;
	}
	
	public IterableMap getIterableAttributes() {
		return (IterableMap)attributes;
	}
	
	public void setAttributes(Map attributes) {
		this.attributes = new HashedMap(attributes);
	}
	
	public Date getEventTime() {
		return eventTime;
	}
	
	public void setEventTime(Date eventTime) {
		this.eventTime = eventTime;
	}

	/**
	 * The original data for this event.
	 * @return
	 */
	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public String getStreamName() {
		return streamName;
	}

	public void setStreamName(String streamName) {
		this.streamName = streamName;
	}

    /**
     * Recycle this event back after the user is no confident there are no more users of this event.
     * <p>In cases when the number of clients of an Event cannot be determined, let <code>gc</code> do it's magic. Invoking
     * this method in such cases will definitely have undesirable effects.
     */
    public void recycle() {

    }
}
